{"ast":null,"code":"export var VALUE_SPLIT = '__RC_CASCADER_SPLIT__';\nexport var SHOW_PARENT = 'SHOW_PARENT';\nexport var SHOW_CHILD = 'SHOW_CHILD';\nexport function toPathKey(value) {\n  return value.join(VALUE_SPLIT);\n}\nexport function toPathKeys(value) {\n  return value.map(toPathKey);\n}\nexport function toPathValueStr(pathKey) {\n  return pathKey.split(VALUE_SPLIT);\n}\nexport function fillFieldNames(fieldNames) {\n  var _ref = fieldNames || {},\n    label = _ref.label,\n    value = _ref.value,\n    children = _ref.children;\n  var val = value || 'value';\n  return {\n    label: label || 'label',\n    value: val,\n    key: val,\n    children: children || 'children'\n  };\n}\nexport function isLeaf(option, fieldNames) {\n  var _option$isLeaf, _option$fieldNames$ch;\n  return (_option$isLeaf = option.isLeaf) !== null && _option$isLeaf !== void 0 ? _option$isLeaf : !((_option$fieldNames$ch = option[fieldNames.children]) === null || _option$fieldNames$ch === void 0 ? void 0 : _option$fieldNames$ch.length);\n}\nexport function scrollIntoParentView(element) {\n  var parent = element.parentElement;\n  if (!parent) {\n    return;\n  }\n  var elementToParent = element.offsetTop - parent.offsetTop; // offsetParent may not be parent.\n  if (elementToParent - parent.scrollTop < 0) {\n    parent.scrollTo({\n      top: elementToParent\n    });\n  } else if (elementToParent + element.offsetHeight - parent.scrollTop > parent.offsetHeight) {\n    parent.scrollTo({\n      top: elementToParent + element.offsetHeight - parent.offsetHeight\n    });\n  }\n}","map":{"version":3,"names":["VALUE_SPLIT","SHOW_PARENT","SHOW_CHILD","toPathKey","value","join","toPathKeys","map","toPathValueStr","pathKey","split","fillFieldNames","fieldNames","_ref","label","children","val","key","isLeaf","option","_option$isLeaf","_option$fieldNames$ch","length","scrollIntoParentView","element","parent","parentElement","elementToParent","offsetTop","scrollTop","scrollTo","top","offsetHeight"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-cascader/es/utils/commonUtil.js"],"sourcesContent":["export var VALUE_SPLIT = '__RC_CASCADER_SPLIT__';\nexport var SHOW_PARENT = 'SHOW_PARENT';\nexport var SHOW_CHILD = 'SHOW_CHILD';\nexport function toPathKey(value) {\n  return value.join(VALUE_SPLIT);\n}\nexport function toPathKeys(value) {\n  return value.map(toPathKey);\n}\nexport function toPathValueStr(pathKey) {\n  return pathKey.split(VALUE_SPLIT);\n}\nexport function fillFieldNames(fieldNames) {\n  var _ref = fieldNames || {},\n    label = _ref.label,\n    value = _ref.value,\n    children = _ref.children;\n  var val = value || 'value';\n  return {\n    label: label || 'label',\n    value: val,\n    key: val,\n    children: children || 'children'\n  };\n}\nexport function isLeaf(option, fieldNames) {\n  var _option$isLeaf, _option$fieldNames$ch;\n  return (_option$isLeaf = option.isLeaf) !== null && _option$isLeaf !== void 0 ? _option$isLeaf : !((_option$fieldNames$ch = option[fieldNames.children]) === null || _option$fieldNames$ch === void 0 ? void 0 : _option$fieldNames$ch.length);\n}\nexport function scrollIntoParentView(element) {\n  var parent = element.parentElement;\n  if (!parent) {\n    return;\n  }\n  var elementToParent = element.offsetTop - parent.offsetTop; // offsetParent may not be parent.\n  if (elementToParent - parent.scrollTop < 0) {\n    parent.scrollTo({\n      top: elementToParent\n    });\n  } else if (elementToParent + element.offsetHeight - parent.scrollTop > parent.offsetHeight) {\n    parent.scrollTo({\n      top: elementToParent + element.offsetHeight - parent.offsetHeight\n    });\n  }\n}"],"mappings":"AAAA,OAAO,IAAIA,WAAW,GAAG,uBAAuB;AAChD,OAAO,IAAIC,WAAW,GAAG,aAAa;AACtC,OAAO,IAAIC,UAAU,GAAG,YAAY;AACpC,OAAO,SAASC,SAAS,CAACC,KAAK,EAAE;EAC/B,OAAOA,KAAK,CAACC,IAAI,CAACL,WAAW,CAAC;AAChC;AACA,OAAO,SAASM,UAAU,CAACF,KAAK,EAAE;EAChC,OAAOA,KAAK,CAACG,GAAG,CAACJ,SAAS,CAAC;AAC7B;AACA,OAAO,SAASK,cAAc,CAACC,OAAO,EAAE;EACtC,OAAOA,OAAO,CAACC,KAAK,CAACV,WAA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